<p id="notice"><%= notice %></p>

<h2>
  <%= if @jc_term.prev then link_to '←', @jc_term.prev end %>
  <%= @jc_term.name %>
  Judicial Committee
  <%= if @jc_term.next then link_to '→', @jc_term.next end %>
</h2>

<h4>Members (<%= @jc_term.jc_memberships.count %>):</h4>
<p>
  <ul>
    <% @jc_term.sorted_jc_memberships.each do |membership| %>
    <li>
      <%= link_to membership.student.full_name, membership.student %> <%= membership.student.jc_selection_suffix %>
      <%= link_to '[X]', [@jc_term, membership], :confirm => 'Are you sure?', :method => :delete %>
    </li>
    <% end %>
  </ul>
</p>

<h4>Add Member</h4>
<p>
  <%= form_for([@jc_term, @jc_term.jc_memberships.build]) do |f| %>
  <table>
    <% @jc_term.available_students.each do |student| %>
    <tr>
      <td>
        <%= f.radio_button :student_id, student.id %>
        <%= link_to student.full_name, student %>
      </td>
      <% student.jc_selection_values.each do |val| %>
      <td><%= val %></td>
      <% end %>
    </tr>
    <% end %>
  </table>
  <%= f.submit 'Add' %>
  <% end %>
</p>
